/**
 * Created by BeeHive.
 * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
 *
 * This source code is licensed under the GNU GENERAL PUBLIC LICENSE.
 * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
 */

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, BYModuleLevel)
{
    BYModuleBasic  = 0,
    BYModuleNormal = 1
};

typedef NS_ENUM(NSInteger, BYModuleEventType)
{
    BYMSetupEvent = 0,
    BYMInitEvent,
    BYMTearDownEvent,
    BYMSplashEvent,
    BYMQuickActionEvent,
    BYMWillResignActiveEvent,
    BYMDidEnterBackgroundEvent,
    BYMWillEnterForegroundEvent,
    BYMDidBecomeActiveEvent,
    BYMWillTerminateEvent,
    BYMUnmountEvent,
    BYMOpenURLEvent,
    BYMDidReceiveMemoryWarningEvent,
    BYMDidFailToRegisterForRemoteNotificationsEvent,
    BYMDidRegisterForRemoteNotificationsEvent,
    BYMDidReceiveRemoteNotificationEvent,
    BYMDidReceiveLocalNotificationEvent,
    BYMWillPresentNotificationEvent,
    BYMDidReceiveNotificationResponseEvent,
    BYMWillContinueUserActivityEvent,
    BYMContinueUserActivityEvent,
    BYMDidFailToContinueUserActivityEvent,
    BYMDidUpdateUserActivityEvent,
    BYMHandleWatchKitExtensionRequestEvent,
    BYMDidCustomEvent = 1000
    
};


@class BYModule;

@interface BYModuleManager : NSObject

+ (instancetype)sharedManager;

// If you do not comply with set Level protocol, the default Normal
- (void)registerDynamicModule:(Class)moduleClass;

- (void)registerDynamicModule:(Class)moduleClass
       shouldTriggerInitEvent:(BOOL)shouldTriggerInitEvent;

- (void)unRegisterDynamicModule:(Class)moduleClass;

- (void)loadLocalModules;

- (void)registedAllModules;

- (void)registerCustomEvent:(NSInteger)eventType
         withModuleInstance:(id)moduleInstance
             andSelectorStr:(NSString *)selectorStr;

- (void)triggerEvent:(NSInteger)eventType;

- (void)triggerEvent:(NSInteger)eventType
     withCustomParam:(NSDictionary *)customParam;



@end

